package com.base.pig.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.base.pig.dto.EventListDto;
import com.base.pig.dto.PendingMattersDto;
import com.base.pig.entity.WEvent;
import com.base.pig.mapper.WEventMapper;
import com.base.pig.service.WEventService;
import com.base.pig.vo.EventListVo;
import com.base.pig.vo.PendingMattersListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yjh
 * @since 2022-03-25
 */
@Service
public class WEventServiceImpl extends ServiceImpl<WEventMapper, WEvent> implements WEventService {

    @Autowired
    private WEventMapper eventMapper;

    @Override
    public IPage<PendingMattersListVo> pendingMattersList(PendingMattersDto pendingMattersDto){
        IPage<PendingMattersListVo> page = new Page<>(pendingMattersDto.getCurrent(), pendingMattersDto.getSize());
        List<PendingMattersListVo> vo = eventMapper.pendingMattersList(page,pendingMattersDto);
        return page.setRecords(vo);
    }

    @Override
    public IPage<EventListVo> queryEventList(EventListDto eventListDto){
        IPage<EventListVo> page = new Page<>(eventListDto.getCurrent(), eventListDto.getSize());
        List<EventListVo> vo = eventMapper.queryEventList(page,eventListDto);
        return page.setRecords(vo);
    }

}
